home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 14 / Hot Mix 14.iso / HTML / vendors / finesse / examples / sh / fslearn < prev    next >
Text File  |  1996-06-27  |  7KB  |  260 lines

  1. #!/bin/sh
  2. # FINESSEAPPLICATIONKEY sKqUrjOmjoAmE
  3.  
  4. #
  5. . ${FINESSEPATH-/usr/local/finesse}/fsshinit
  6.  
  7. show()
  8. {
  9. n=1
  10.  
  11. while :
  12. do
  13.  
  14. if [ $n -gt 4 ] ; then 
  15.     n=4
  16. fi
  17.  
  18. a="win$n"
  19.  
  20. if [ "$n" != "1" -a "$fsbutton" != "info" ] ; then
  21.     Fsecho -e
  22.         Fsecho ' '
  23.     Fsecho "Currently displaying window: $n"
  24.         Fsecho ' '
  25.     Fsecho "Press info button for more information."
  26. fi
  27.  
  28.  
  29. $a
  30.  
  31. if [ "$fsbutton" = "about" ] ; then
  32.     aboutfinesse
  33. fi
  34.  
  35. if [ "$fsbutton" = "info" ] ; then
  36.     info$a
  37. fi
  38.  
  39. if [ "$fsbutton" = "continue" ] ; then
  40.     n=`expr $n + 1`
  41. fi
  42.  
  43. if [ "$fsbutton" = "back" ] ; then
  44.     n=`expr $n - 1`
  45. fi
  46.  
  47. if [ "$fsbutton" = "exit" ] ; then
  48.     Fsclose
  49.     exit 0
  50. fi
  51.  
  52. done
  53. }
  54.  
  55.  
  56. win0()
  57. {
  58. n=1
  59. win1
  60. }
  61.  
  62.  
  63. win1()
  64. {
  65.   windef1="
  66.   FsWindow        -title 'Finesse Demo 1'
  67.           -name windef1;
  68.   FsSeparator;
  69.   FsForm                -name form1   -orientation vertical;
  70.   FsLabel -parent form1 -name lt1 -label 'Finesse 4.x' ; 
  71.   FsLabel -parent form1 -label 'New features and introduction.' ;
  72.   FsLabel -parent form1 -label '' ;
  73.   FsLabel -parent form1 -label 'Please read the comments in the echo window' ; 
  74.   FsLabel -parent form1 -label 'which will appear if you press the Continue button.' ;
  75.   FsSeparator;
  76.   FsPushButton -label Continue -fsbutton continue -winstat close;
  77.   FsPushButton -label Exit -fsbutton exit -winstat close;
  78.   FsPushButton -label 'About Finesse' -fsbutton about -winstat touch;"
  79.  
  80.   Fsdisplay -m FINESSEDEMO -w "$windef1" -n windef1
  81. }
  82.  
  83. infowin1()
  84. {
  85.   Fsecho -e
  86.   Fsecho -p beginning -t 'Information for window 1
  87. ========================================
  88. '"$windef1"
  89. }
  90.  
  91.  
  92.  
  93. win2()
  94. {
  95. windef2=
  96.   windef2="
  97.   FsWindow        -title 'Finesse Demo 2'
  98.           -name windef2;
  99.   FsSeparator;
  100.   FsForm                -name formB1   -orientation vertical;
  101.   FsForm -parent formB1  -name formB11  -orientation horizontal;
  102.   FsForm -parent formB1  -name formB12  -orientation horizontal;
  103.   FsLabel -parent formB11 -label Form11 ; 
  104.   FsLabel -parent formB12 -label Form12 ; 
  105.   FsSeparator;
  106.   FsPushButton -label Continue -fsbutton continue -winstat close;
  107.   FsPushButton -label Back -fsbutton back -winstat close;
  108.   FsPushButton -label Info -fsbutton info -winstat touch;
  109.   FsPushButton -label Exit -fsbutton exit -winstat close;"
  110.  
  111.   Fsdisplay -m FINESSEDEMO -w "$windef2" -n windef2
  112.  
  113. }
  114.  
  115. infowin2()
  116. {
  117.   Fsecho -e
  118.   Fsecho -p beginning -t 'Information for window 2
  119. ========================================
  120. Finesse allows you to partition a window into forms.
  121. Each form may be a container for further objects,
  122. like buttons, labels, check boxes, etc.
  123.  
  124. A form 
  125. * can contain other forms
  126. * has an orientation which describes how
  127.   elements are aligned within this form
  128.  
  129. In this window we build two subareas:
  130.     Form11
  131.     Form12
  132.  
  133. The colors are defined in a resource file. There
  134. the different objects are referenced by the
  135. name you defined in the window declaration.
  136. The name of Form12 is formb11, the name of
  137. Form12 is formb12.
  138.  
  139. The windowdefinition is as follows:
  140. '"$windef2"
  141. }
  142.  
  143. win3()
  144. {
  145. windef3=
  146.   windef3="
  147.   FsWindow        -title 'Finesse Demo 3'
  148.           -name windef3;
  149.   FsSeparator;
  150.   FsForm                -name form1   -orientation vertical;
  151.   FsForm -parent form1  -name form11  -orientation horizontal;
  152.   FsForm -parent form1  -name form12  -orientation horizontal;
  153.   FsForm -parent form11 -name form111 -orientation vertical;
  154.   FsForm -parent form11 -name form112 -orientation vertical;
  155.   FsLabel -parent form111 -label Form111 ; 
  156.   FsLabel -parent form112 -label Form112 ; 
  157.   FsLabel -parent form12 -label Form12 ; 
  158.   FsSeparator;
  159.   FsPushButton -label Continue -fsbutton continue -winstat close;
  160.   FsPushButton -label Back -fsbutton back -winstat close;
  161.   FsPushButton -label Info -fsbutton info -winstat touch;
  162.   FsPushButton -label Exit -fsbutton exit -winstat close;"
  163.  
  164.   Fsdisplay -m FINESSEDEMO -w "$windef3" -n windef3
  165.  
  166. }
  167.  
  168. infowin3()
  169. {
  170.   Fsecho -e
  171.   Fsecho -p beginning -t 'Information for window 3
  172. ========================================
  173. This window shows 3 form areas in different colors.
  174. We have separated the upper form into two parts:
  175.  
  176. Form11 : Form111
  177.      Form112
  178.  
  179. Now we have three forms, which will be filled
  180. by some obejcts in the next frame.
  181.  
  182. The window definition is:
  183. '"$windef3"
  184. }
  185.  
  186.  
  187. win4()
  188. {
  189. windef4=
  190.   windef4="
  191.   FsWindow        -title 'Finesse Demo 4'
  192.           -name windef4;
  193.   FsSeparator;
  194.   FsForm                -name form41   -orientation vertical;
  195.   FsForm -parent form41  -packing tight -name form411  -orientation horizontal;
  196.   FsForm -parent form41  -packing tight -name form412  -orientation horizontal;
  197.   FsForm -parent form411 -packing tight -name form4111 -orientation vertical;
  198.   FsForm -parent form411 -packing tight -name form4112 -orientation vertical;
  199.   FsSeparator;
  200.   FsPushButton -label Continue -fsbutton continue -winstat close;
  201.   FsPushButton -label Back -fsbutton back -winstat close;
  202.   FsPushButton -label Info -fsbutton info -winstat touch;
  203.   FsPushButton -label Exit -fsbutton exit -winstat close;
  204.  
  205.   FsCheck  -parent form4111 -name check1 -nrows 3 -label 'Check Box' 
  206.        -var chk1==Germany -items 'U.S.A. Germany Japan' ;
  207.   FsPushButton -parent form4111 -winstat touch -name but1 -nrows 2 -label Button2 ;
  208.   FsPushButton -parent form4111 -winstat touch -name but2 -label Button1 ;
  209.  
  210.   FsLabel -parent form4112 -label 'Label for List' -name lab1 ;
  211.   FsList  -parent form4112 -name list1  -nvisible 5 
  212.       -items 'List: Train Car Airplane Rocket Bike Bus' -var listvar1 ;
  213.   FsText  -parent form4112 -name text2 -label 'Text widget 2' -var vtext2 ;
  214.  
  215.   FsText  -parent form412 -name text1 -packing tight
  216.           -label 'Text widget 1' -var vtext1 ;
  217.   FsRadio -parent form412 -name rad1  -var vrad1 -nrows 1 -items 'Chicago Dallas Berlin' ;
  218. "
  219.  
  220.   Fsdisplay -m FINESSEDEMO -w "$windef4" -n windef4
  221.  
  222. }
  223. infowin4()
  224. {
  225.   Fsecho -e
  226.   Fsecho -t 'Information for window 4
  227. ========================================
  228. In this window a lot of different types of Finesse 
  229. objects are displayed. The three colors indicate
  230. the corresponding parent form.
  231.  
  232. The window description is:
  233. '"$windef4" -p beginning
  234. }
  235.  
  236. aboutfinesse()
  237. {
  238. aboutwin="
  239.   FsWindow        -title 'About Finesse'
  240.           -name aboutfinesse;
  241.   FsSeparator;
  242.   FsForm  -name aboutform   -orientation vertical;
  243.   FsLabel -parent aboutform -name a1 -label 'Finesse' ; 
  244.   FsLabel -parent aboutform -name a2 -label 'is a product of science + computing GmbH, Germany' ; 
  245.   FsLabel -parent aboutform -name a4 -label 'copyright by s+c, 1996' ;
  246.   FsSeparator;
  247.   FsPushButton -label Continue -fsbutton continuedemo -winstat close;
  248. "
  249.   Fsdisplay -m FINESSE -w "$aboutwin" -n aboutfinesse
  250.  
  251. }
  252.  
  253.  
  254. Fsopen "$@"
  255.  
  256. show
  257.  
  258. Fssave
  259. Fsclose
  260.